package lambda;

/**
 * @author: wh(1835734390 @ qq.com)
 * @date: 2023/2/22 13:48
 * @description:
 * @version:
 */
public class AnonymousDemo {
    public static void main(String[] args) {
        //使用临时定义的类
        IEncoder encoder = new IEncoder() {
            @Override
            public int encode(int num) {
                return num + 1;
            }
        };
        int result = encoder.encode(1);
        System.out.println("加密结果" + result);
    }
}
